home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacMETH 3.2.1 / MacMETH Manual 1992 / Manual Examples / WindowExample.MOD < prev   
Encoding:
Text File  |  1992-10-09  |  875 b   |  37 lines  |  [TEXT/MEDT]

  1. MODULE WindowExample; (* general window demo (refreshing windows) *)
  2.  
  3.     FROM Windows    IMPORT Window, PlaceOnTop;
  4.     FROM TerminalIn    IMPORT Read;
  5.     IMPORT TextWindows;
  6.     IMPORT GraphicWindows;
  7.  
  8.     VAR     a,b     : Window;
  9.             Ok      : BOOLEAN;
  10.             ch      : CHAR;
  11.  
  12.     PROCEDURE RestoreGraphic(w : Window);
  13.     BEGIN
  14.         GraphicWindows.Circle(w,150,150,100);
  15.     END RestoreGraphic;
  16.  
  17.     PROCEDURE RestoreText(w : Window);
  18.     BEGIN
  19.         TextWindows.SetPos(w,10,2);
  20.         TextWindows.WriteString(w,"This is an example for restoring windows.");
  21.     END RestoreText;
  22.  
  23. BEGIN
  24.     GraphicWindows.OpenGraphicWindow(a,0,0,300,300,"Graphic",RestoreGraphic);
  25.     TextWindows.OpenTextWindow(b,20,20,300,300,"Text");
  26.     TextWindows.AssignRestoreProc(b,RestoreText);
  27.     REPEAT
  28.         PlaceOnTop(a);
  29.         Read(ch);
  30.         PlaceOnTop(b);
  31.         Read(ch)
  32.     UNTIL (ch < " ");
  33.     TextWindows.CloseTextWindow(b);
  34.     GraphicWindows.CloseGraphicWindow(a);
  35. END WindowExample.
  36.  
  37.